﻿using System;
using Microsoft.SharePoint.Workflow;

namespace SharePoint.Orm.Wrappers {
	public class SPOrmSharePointWorkflowTask : ISPOrmWorkflowTask {
		private readonly SPWorkflowTask _workflowTask;
		private readonly SPDataContext _ctx;

		public SPOrmSharePointWorkflowTask(SPDataContext ctx, SPWorkflowTask workflowTask) {
			_ctx = ctx;
			_workflowTask = workflowTask;
		}

		public virtual SPWorkflowTask SPWorkflowTask {
			get { return _workflowTask; }
		}

		public T Attach<T>() where T : ISPOrmObject {
			return _ctx.Attach<T>(_workflowTask);
		}
	}
}
